package com.topcheer.common.auth.interceptor;

import com.topcheer.common.auth.context.BaseContextHandler;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author xutao
 * @Package com.topcheer.common.auth.interceptor
 * @Description: ${todo}
 * @date 2020/4/9 14:45
 */
public class FeignInterceptor implements RequestInterceptor {

    @Value("${jwt.token-header}")
    private String tokenHeader;

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header(tokenHeader, BaseContextHandler.getToken());
    }
}
